#define _CRT_SECURE_NO_WARNINGS 1

#define _CRT_SECURE_NO_WARNINGS 1

int isWinner(int* player1, int player1Size, int* player2, int player2Size) {
    if (player1Size == 1)
    {
        if (*player1 == *player2)
            return 0;
        return *player1 > *player2 ? 1 : 2;
    }

    int play1 = 0, play2 = 0;
    for (int i = 2; i < player1Size; i++)
    {
        play1 = play1 + (player1[i]) * ((player1[i - 1] == 10 || player1[i - 2] == 10) ? 2 : 1);
        play2 = play2 + (player2[i]) * ((player2[i - 1] == 10 || player2[i - 2] == 10) ? 2 : 1);
    }
    play1 += player1[0] + (player1[1] * (player1[0] == 10 ? 2 : 1));
    play2 += player2[0] + (player2[1] * (player2[0] == 10 ? 2 : 1));

    if (play1 == play2)
        return 0;
    return play1 > play2 ? 1 : 2;
}